package com.zy.di.pro1_value_annotation;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@Data  //lombok注解，自动生成getter和setter方法，toString方法，equals方法，hashCode方法，非空构造方法
public class Product {
    @Value("${pid}")
    private int pid;
    @Value("${pname}")
    private String pname;
    @Value("${price}")
    private double price;
}
